package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysLesseeMapper;
import com.ruoyi.system.domain.SysLessee;
import com.ruoyi.system.service.ISysLesseeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 租户Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-22
 */
@Service
public class SysLesseeServiceImpl implements ISysLesseeService 
{
    @Autowired
    private SysLesseeMapper sysLesseeMapper;

    /**
     * 查询租户
     * 
     * @param lesseeId 租户ID
     * @return 租户
     */
    @Override
    public SysLessee selectSysLesseeById(Long lesseeId)
    {
        return sysLesseeMapper.selectSysLesseeById(lesseeId);
    }

    /**
     * 查询租户列表
     * 
     * @param sysLessee 租户
     * @return 租户
     */
    @Override
    public List<SysLessee> selectSysLesseeList(SysLessee sysLessee)
    {
        return sysLesseeMapper.selectSysLesseeList(sysLessee);
    }

    /**
     * 新增租户
     * 
     * @param sysLessee 租户
     * @return 结果
     */
    @Override
    public int insertSysLessee(SysLessee sysLessee)
    {
        sysLessee.setCreateTime(DateUtils.getNowDate());
        return sysLesseeMapper.insertSysLessee(sysLessee);
    }

    /**
     * 修改租户
     * 
     * @param sysLessee 租户
     * @return 结果
     */
    @Override
    public int updateSysLessee(SysLessee sysLessee)
    {
        sysLessee.setUpdateTime(DateUtils.getNowDate());
        return sysLesseeMapper.updateSysLessee(sysLessee);
    }

    /**
     * 删除租户对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysLesseeByIds(String ids)
    {
        return sysLesseeMapper.deleteSysLesseeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除租户信息
     * 
     * @param lesseeId 租户ID
     * @return 结果
     */
    @Override
    public int deleteSysLesseeById(Long lesseeId)
    {
        return sysLesseeMapper.deleteSysLesseeById(lesseeId);
    }
}
